﻿<local:SelectFormatPageBase
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:Com.PhilChuang.Mobile.Apps.LocationSender.Ui.Views.Impl.Pages"
	xmlns:Microsoft_Phone_Controls_Maps="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps" 
	x:Class="Com.PhilChuang.Mobile.Apps.LocationSender.Ui.Views.Impl.Pages.SelectFormatPage"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" d:DataContext="{d:DesignData /SampleData/SelectFormatPageViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
	IsEnabled="{Binding AllControlsEnabled}">

	<local:SelectFormatPageBase.Resources>
		<DataTemplate x:Key="DataTemplate1">
			<Grid Margin="0,0,0,12">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<TextBlock Text="{Binding Format}" HorizontalAlignment="Left" VerticalAlignment="Top">
					<TextBlock.Foreground>
						<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
					</TextBlock.Foreground>
				</TextBlock>
				<TextBlock Grid.Row="1" Text="{Binding FormatResult}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
			</Grid>
		</DataTemplate>
	</local:SelectFormatPageBase.Resources>

	<!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

		<!--TitlePanel contains the name of the application and page title-->
		<StackPanel x:Name="TitlePanel" Margin="12,0,0,12">
			<TextBlock x:Name="ApplicationTitle" Margin="-12,0,0,0" Text="{Binding AppVersionString}" Style="{StaticResource PhoneTextNormalStyle}"/>
			<TextBlock x:Name="PageTitle" Text="Select Format" Margin="12,-7,0,-7" Style="{StaticResource PhoneTextTitle1Style}"/>
		</StackPanel>

		<!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="200"/>
				<RowDefinition Height="Auto"/>
				<RowDefinition />
			</Grid.RowDefinitions>

			<TextBlock TextWrapping="Wrap" Text="{Binding AppStatus}" Style="{StaticResource PhoneTextNormalStyle}" HorizontalAlignment="Center" VerticalAlignment="Top">
				<TextBlock.Foreground>
					<SolidColorBrush Color="{StaticResource PhoneSubtleColor}"/>
				</TextBlock.Foreground>
			</TextBlock>
			<Microsoft_Phone_Controls_Maps:Map x:Name="g_Map" Margin="-12,0,-12,0" Grid.Row="1" CredentialsProvider="{Binding BingMapsCredentials}">
				<Microsoft_Phone_Controls_Maps:Map.Mode>
					<Microsoft_Phone_Controls_Maps:AerialMode ShouldDisplayLabels="True" AnimationLevel="Full" />
				</Microsoft_Phone_Controls_Maps:Map.Mode>
			</Microsoft_Phone_Controls_Maps:Map>
			<TextBlock Text="Select a format below" Style="{StaticResource PhoneTextLargeStyle}" Grid.Row="2" HorizontalAlignment="Center" />
			<ListBox Margin="12,0,-12,0" Grid.Row="3" ItemsSource="{Binding FormatsAndResults}" Padding="0,0,12,0" ItemTemplate="{StaticResource DataTemplate1}" SelectionChanged="ListBox_SelectionChanged"/>
		</Grid>
		
    </Grid>

</local:SelectFormatPageBase>